package cn.zhizihua.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 食品管理
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL) //关联查询结果展示包含非空的字段  （如果字段是空的，转JSON时自动忽略掉了）
@TableName("food")
public class Food {
    @TableId(value = "foodId",type = IdType.AUTO)
    private Integer foodId;
    private String foodName;
    private String foodExplain;
    private String foodImg;
    private Double foodPrice;
    private Integer businessId; //所属商家id
    private String remarks;

    //餐品所属商家
    @TableField(exist = false)  //标记为不存在
    private Business business;   // 用于多表联查 获取商家信息
}
